package p.ithorns.framework.crypto.core;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.io.support.SpringFactoriesLoader;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import p.ithorns.framework.crypto.CryptoAutoConfiguration;
import p.ithorns.framework.crypto.annotation.EnableCrypto;

import java.util.List;

/**
 * CryptoImportSelector
 * @author ithorns
 * @version 1.0
 * @date 2019/5/24 14:52
 */
public class CryptoImportSelector implements ImportSelector {
    @Override
    public String[] selectImports(AnnotationMetadata annotationMetadata) {
        Class<?> springFactoriesLoaderFactoryClass = getSpringFactoriesLoaderFactoryClass();
        return new String[]{springFactoriesLoaderFactoryClass.getName()};
    }

    protected Class<?> getSpringFactoriesLoaderFactoryClass() {
        return CryptoAutoConfiguration.class;
    }

}